Bentley Descartes CONNECT Edition

Color Mask Applications

A color mask lets you handle any image with more than two colors exactly as if it was a two-color image. It is what we call a “dynamic binariser” as it dynamically converts all colors of the mask into the “drawing” color, and all the rest into the “backfill” color. A color mask cannot be defined for two-color images, as they already have only a foreground color and a background color. All tools used for image editing or vectorization, normally work with binary (two color) images only. Because of the color mask feature, these tools can now be used with images that have more than two colors.

A color mask specifically determines what will be considered as the “drawing” colors for various “raster” operations. For a given image, you can define an unlimited number of color masks to be saved in the same color mask file. For example, all colors rendering red lines on a scanned map constitute a color mask, while all colors rendering green lines or bodies constitute another mask. Another class of raster objects can be rendered with a mixture of red and green pixels that compose another color mask. A given color can be present in more than one mask.

In the Color Mask dialog, one default mask will always be available even when no mask file is opened:

  • The (Temp) mask is an editable mask that is never saved in a mask file.

The concept of “Chameleon-Mask” is similar to the standard mask except that it can have one or more sub-masks that are a specialization of the parent mask for a specific image. The mask can be applied to any image and the sub-mask will be applied only on the image to which they have been assigned. The names of the masks included in the chameleon mask are automatically generated. The name of each mask is generated by using the following rules:

  • The name of the parent mask.

  • An underscore.

  • The name of the image to which the mask is attached (with no path).

If two images have the same name, the path will be added in order to differentiate the two files. For example, the following table shows the names that will be generated if we try to add the following images to the “CITY” chameleon mask:

Image file name

Generated mask name

C:\dataset\newyork\images\raster1.hmr

CITY_newyork-images-raster1-hmr

C:\dataset\chicago\images\raster1.hmr

CITY_chicago-images-raster1-hmr

C:\dataset\losangeles\images\raster2.hmr

CITY_raster2-hmr

Note: If a layer is made up of a finite number of a few distinct colors, the mask will be properly applied at all scales.

Color masks applied to WMS RGB layers are only valid at the zoom scale where the mask was created.